function addProductApi(data){
    return axios.post('/product', data)
}

function pageProductsApi(page, pageSize, name) {
    return axios.get('/product/page', {
        params: {
            page: page,
            pageSize: pageSize,
            name: name
        }
    })
}

function getProductApi(id){
    return axios.get(`/product/${id}`)
}

function delProductApi(id){
    return axios.delete(`/product/${id}`)
}

function updateProductApi(data){
    return axios.put('/product', data)
}

function getProductsListApi(){
    return axios.get('/product/list')
}


function pageProductsSubApi(page, pageSize, name) {
    return axios.get('/product/subPage', {
        params: {
            page: page,
            pageSize: pageSize,
            name: name
        }
    })
}

function getProductNameByIdApi(productId){
    return axios.get(`/product/getName/${productId}`)
}


function getProductPhotoByIdApi(productId){
    return axios.get(`/product/getPhoto/${productId}`)
}
